3.1.39 \(\int \frac {(2+3 x+5 x^2)^2}{3-x+2 x^2} \, dx\) [39]

Optimal. Leaf size=56 \[ \frac {51 x}{8}+\frac {85 x^2}{8}+\frac {25 x^3}{6}+\frac {847 \tan ^{-1}\left (\frac {1-4 x}{\sqrt {23}}\right )}{16 \sqrt {23}}-\frac {363}{32} \log \left (3-x+2 x^2\right ) \]

[Out]

51/8*x+85/8*x^2+25/6*x^3-363/32*ln(2*x^2-x+3)+847/368*arctan(1/23*(1-4*x)*23^(1/2))*23^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 56, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {1671, 648, 632, 210, 642} \begin {gather*} \frac {847 \text {ArcTan}\left (\frac {1-4 x}{\sqrt {23}}\right )}{16 \sqrt {23}}+\frac {25 x^3}{6}+\frac {85 x^2}{8}-\frac {363}{32} \log \left (2 x^2-x+3\right )+\frac {51 x}{8} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(2 + 3*x + 5*x^2)^2/(3 - x + 2*x^2),x]

[Out]

(51*x)/8 + (85*x^2)/8 + (25*x^3)/6 + (847*ArcTan[(1 - 4*x)/Sqrt[23]])/(16*Sqrt[23]) - (363*Log[3 - x + 2*x^2])
/32

Rule 210

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[-b, 2])^(-1))*ArcTan[Rt[-b, 2]*(x/Rt[-a, 2])
], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rule 632

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 642

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[d*(Log[RemoveContent[a + b*x +
c*x^2, x]]/b), x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rule 648

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[(2*c*d - b*e)/(2*c), Int[1/(a +
 b*x + c*x^2), x], x] + Dist[e/(2*c), Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x] &
& NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] &&  !NiceSqrtQ[b^2 - 4*a*c]

Rule 1671

Int[(Pq_)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[Pq*(a + b*x + c*x^2)^p, x
], x] /; FreeQ[{a, b, c}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rubi steps

\begin {align*} \int \frac {\left (2+3 x+5 x^2\right )^2}{3-x+2 x^2} \, dx &=\int \left (\frac {51}{8}+\frac {85 x}{4}+\frac {25 x^2}{2}-\frac {121 (1+3 x)}{8 \left (3-x+2 x^2\right )}\right ) \, dx\\ &=\frac {51 x}{8}+\frac {85 x^2}{8}+\frac {25 x^3}{6}-\frac {121}{8} \int \frac {1+3 x}{3-x+2 x^2} \, dx\\ &=\frac {51 x}{8}+\frac {85 x^2}{8}+\frac {25 x^3}{6}-\frac {363}{32} \int \frac {-1+4 x}{3-x+2 x^2} \, dx-\frac {847}{32} \int \frac {1}{3-x+2 x^2} \, dx\\ &=\frac {51 x}{8}+\frac {85 x^2}{8}+\frac {25 x^3}{6}-\frac {363}{32} \log \left (3-x+2 x^2\right )+\frac {847}{16} \text {Subst}\left (\int \frac {1}{-23-x^2} \, dx,x,-1+4 x\right )\\ &=\frac {51 x}{8}+\frac {85 x^2}{8}+\frac {25 x^3}{6}+\frac {847 \tan ^{-1}\left (\frac {1-4 x}{\sqrt {23}}\right )}{16 \sqrt {23}}-\frac {363}{32} \log \left (3-x+2 x^2\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 52, normalized size = 0.93 \begin {gather*} \frac {1}{24} x \left (153+255 x+100 x^2\right )-\frac {847 \tan ^{-1}\left (\frac {-1+4 x}{\sqrt {23}}\right )}{16 \sqrt {23}}-\frac {363}{32} \log \left (3-x+2 x^2\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(2 + 3*x + 5*x^2)^2/(3 - x + 2*x^2),x]

[Out]

(x*(153 + 255*x + 100*x^2))/24 - (847*ArcTan[(-1 + 4*x)/Sqrt[23]])/(16*Sqrt[23]) - (363*Log[3 - x + 2*x^2])/32

________________________________________________________________________________________

Maple [A]
time = 0.14, size = 44, normalized size = 0.79

method result size
default \(\frac {25 x^{3}}{6}+\frac {85 x^{2}}{8}+\frac {51 x}{8}-\frac {363 \ln \left (2 x^{2}-x +3\right )}{32}-\frac {847 \sqrt {23}\, \arctan \left (\frac {\left (4 x -1\right ) \sqrt {23}}{23}\right )}{368}\) \(44\)
risch \(\frac {25 x^{3}}{6}+\frac {85 x^{2}}{8}+\frac {51 x}{8}-\frac {363 \ln \left (16 x^{2}-8 x +24\right )}{32}-\frac {847 \sqrt {23}\, \arctan \left (\frac {\left (4 x -1\right ) \sqrt {23}}{23}\right )}{368}\) \(44\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((5*x^2+3*x+2)^2/(2*x^2-x+3),x,method=_RETURNVERBOSE)

[Out]

25/6*x^3+85/8*x^2+51/8*x-363/32*ln(2*x^2-x+3)-847/368*23^(1/2)*arctan(1/23*(4*x-1)*23^(1/2))

________________________________________________________________________________________

Maxima [A]
time = 0.52, size = 43, normalized size = 0.77 \begin {gather*} \frac {25}{6} \, x^{3} + \frac {85}{8} \, x^{2} - \frac {847}{368} \, \sqrt {23} \arctan \left (\frac {1}{23} \, \sqrt {23} {\left (4 \, x - 1\right )}\right ) + \frac {51}{8} \, x - \frac {363}{32} \, \log \left (2 \, x^{2} - x + 3\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((5*x^2+3*x+2)^2/(2*x^2-x+3),x, algorithm="maxima")

[Out]

25/6*x^3 + 85/8*x^2 - 847/368*sqrt(23)*arctan(1/23*sqrt(23)*(4*x - 1)) + 51/8*x - 363/32*log(2*x^2 - x + 3)

________________________________________________________________________________________

Fricas [A]
time = 1.95, size = 43, normalized size = 0.77 \begin {gather*} \frac {25}{6} \, x^{3} + \frac {85}{8} \, x^{2} - \frac {847}{368} \, \sqrt {23} \arctan \left (\frac {1}{23} \, \sqrt {23} {\left (4 \, x - 1\right )}\right ) + \frac {51}{8} \, x - \frac {363}{32} \, \log \left (2 \, x^{2} - x + 3\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((5*x^2+3*x+2)^2/(2*x^2-x+3),x, algorithm="fricas")

[Out]

25/6*x^3 + 85/8*x^2 - 847/368*sqrt(23)*arctan(1/23*sqrt(23)*(4*x - 1)) + 51/8*x - 363/32*log(2*x^2 - x + 3)

________________________________________________________________________________________

Sympy [A]
time = 0.05, size = 60, normalized size = 1.07 \begin {gather*} \frac {25 x^{3}}{6} + \frac {85 x^{2}}{8} + \frac {51 x}{8} - \frac {363 \log {\left (x^{2} - \frac {x}{2} + \frac {3}{2} \right )}}{32} - \frac {847 \sqrt {23} \operatorname {atan}{\left (\frac {4 \sqrt {23} x}{23} - \frac {\sqrt {23}}{23} \right )}}{368} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((5*x**2+3*x+2)**2/(2*x**2-x+3),x)

[Out]

25*x**3/6 + 85*x**2/8 + 51*x/8 - 363*log(x**2 - x/2 + 3/2)/32 - 847*sqrt(23)*atan(4*sqrt(23)*x/23 - sqrt(23)/2
3)/368

________________________________________________________________________________________

Giac [A]
time = 2.13, size = 43, normalized size = 0.77 \begin {gather*} \frac {25}{6} \, x^{3} + \frac {85}{8} \, x^{2} - \frac {847}{368} \, \sqrt {23} \arctan \left (\frac {1}{23} \, \sqrt {23} {\left (4 \, x - 1\right )}\right ) + \frac {51}{8} \, x - \frac {363}{32} \, \log \left (2 \, x^{2} - x + 3\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((5*x^2+3*x+2)^2/(2*x^2-x+3),x, algorithm="giac")

[Out]

25/6*x^3 + 85/8*x^2 - 847/368*sqrt(23)*arctan(1/23*sqrt(23)*(4*x - 1)) + 51/8*x - 363/32*log(2*x^2 - x + 3)

________________________________________________________________________________________

Mupad [B]
time = 3.44, size = 45, normalized size = 0.80 \begin {gather*} \frac {51\,x}{8}-\frac {363\,\ln \left (2\,x^2-x+3\right )}{32}-\frac {847\,\sqrt {23}\,\mathrm {atan}\left (\frac {4\,\sqrt {23}\,x}{23}-\frac {\sqrt {23}}{23}\right )}{368}+\frac {85\,x^2}{8}+\frac {25\,x^3}{6} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((3*x + 5*x^2 + 2)^2/(2*x^2 - x + 3),x)

[Out]

(51*x)/8 - (363*log(2*x^2 - x + 3))/32 - (847*23^(1/2)*atan((4*23^(1/2)*x)/23 - 23^(1/2)/23))/368 + (85*x^2)/8
 + (25*x^3)/6

________________________________________________________________________________________